|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectalgalcommand.io.AlgalNetIO
public class AlgalNetIO
Copyright Owner: Michigan State University, license number TEC2011-002101Prov
| Field Summary | |
|---|---|
static java.lang.String |
COMMAND_PREFIX
This is the prefix that the PBRBrain uses to differentiate commands from other stuff that it receives from its serial input |
static java.lang.String |
COMMAND_SUFFIX
The suffix is used by the PBRBrain to know when to parse the input command (actually, the PBRBrain is usually smart enough to not need this, but that behavior is not a design spec., so that may not always be true). |
static java.lang.String |
PING_COMMAND
This is the ping command |
static java.lang.String |
PING_RESPONCE_TAGNAME
Name of the XML tag that is sent back in responce to a ping |
| Constructor Summary | |
|---|---|
AlgalNetIO()
|
|
| Method Summary | |
|---|---|
byte[] |
connectToAddress(java.lang.String networkAddress)
Connects to the given IP address (tries to, anyway). |
byte[] |
getMAC()
|
boolean |
sendCommand(java.lang.String text)
Sends a command to the PBRBrain over the network |
void |
startListening()
|
void |
stopListening()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final java.lang.String COMMAND_PREFIX
public static final java.lang.String COMMAND_SUFFIX
public static final java.lang.String PING_COMMAND
public static final java.lang.String PING_RESPONCE_TAGNAME
| Constructor Detail |
|---|
public AlgalNetIO()
| Method Detail |
|---|
public byte[] connectToAddress(java.lang.String networkAddress)
throws java.net.SocketException,
java.io.IOException
networkAddress -
java.net.SocketException - Thrown if the socket could not be created.
java.io.IOException - Thrown if the socket could not be used.public byte[] getMAC()
public boolean sendCommand(java.lang.String text)
text - The command to send
true if the command was sent successfully,
false otherwise.
public void startListening()
throws java.io.IOException
java.io.IOExceptionpublic void stopListening()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||